From e7adcb0f395a0aae6ea288feaf2c721ff8266173 Mon Sep 17 00:00:00 2001 From: robertl Date: Mon, 1 Dec 2003 22:13:34 +0000 Subject: [PATCH] Describe Ron's fix. --- gpsbabel/gpx.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/gpsbabel/gpx.c b/gpsbabel/gpx.c index 066049210..f40512b66 100644 --- a/gpsbabel/gpx.c +++ b/gpsbabel/gpx.c @@ -783,6 +783,19 @@ gpx_read(void) while (!done) { if ( fd ) { + /* + * The majority of this block (in fact, all but the + * call to XML_Parse) are a disgusting hack to + * correct defective GPX files that Geocaching.com + * issues as pocket queries. They contain escape + * characters as entities (�-) which makes + * them not validate which croaks expat and torments + * users. + * + * Look for '&' in the last 6 chars. If we find + * it, strip it, then read byte-at-a-time until + * we find a non-entity. + */ char *badchar; char *semi; len = fread(buf, 1, sizeof(buf)-7, fd); -- 2.30.2